package org.atlantis.grosbeak.lang.filefilter;

import java.io.File;
import java.io.FileFilter;

/**
 * 
 * @author <a href="mailto:seenoevil.cn@gmail.com">SeeNoEvil</a>
 * 
 */
public class OrFilter implements FileFilter {

	private FileFilter[] filters;

	public OrFilter(FileFilter... filters) {
		this.filters = filters;
	}

	public boolean accept(File pathname) {
		boolean flag = false;
		for (FileFilter filter : filters) {
			flag = (flag || filter.accept(pathname));
			if (flag)
				break;
		}
		return flag;
	}
}
